package com.zy.chat.util;

import com.zy.chat.dto.LoginFormDTO;

/**
 * @author zy
 * @date 2023/6/4 20:28
 */
public class UserHolder {
    private static final ThreadLocal<LoginFormDTO> userHolder=new ThreadLocal<>();

    public static void setUserHolder(LoginFormDTO loginFormDTO){
        userHolder.set(loginFormDTO);
    }

    public static LoginFormDTO getUser(){
        return userHolder.get();
    }

    public static void removeUser(){
        userHolder.remove();
    }
}
